﻿using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;

namespace Zhaoxi.NLogSample.NoIOCLog
{
    public class TestLog2
    {

        /// <summary>
        /// 输出日志实例
        /// </summary>
        public void Show() 
        {
            string[] leveles = { "Trace", "Debug", "Info", "Warn", "Error", "Fatal" }; // 获取日志级别
            foreach (var level in leveles) // 遍历日志级别
            {
                Log.logger2.Log(NLog.LogLevel.FromString(level), $"这是一条{level}消息");
            }
            Log.logger2.Trace($"这是一条Trace消息");
            Log.logger2.Debug($"这是一条Debug消息");
            Log.logger2.Info($"这是一条 Info 消息");
            Log.logger2.Warn($"这是一条 Warn 消息");
            Log.logger2.Error($"这是一条 Error 消息");
            Log.logger2.Fatal($"这是一条 Fatal 消息");
        }
    }
}
